<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>TyrantGenesis 自制组件</title>
    <link rel="stylesheet" href="../css/element-ui.css">
    <style>
        html, body {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 48px;
            overflow: hidden;
        }
        #app {
            width: 100%;
            display: flex;
            flex-direction: row;
            justify-content: center;
        }
        .tab {
            margin: 12px auto;
        }
    </style>
</head>
<body>
<div id="app">
    <el-radio-group class="tab" v-model="value" @change="switchTab" size="mini">
        <el-radio-button :label="item.id" v-for="item in tabs" :key="item.id">{{item.title}}</el-radio-button>
    </el-radio-group>
</div>
<script src="../js/vue.min.js"></script>
<script src="../js/element-ui.js"></script>
<script>
    new Vue({
        el: '#app',
        data() {
            return {
                value: 0,
                tabs: [
                    {id: 0, title: '我的歌单'},
                    {id: 1, title: '所有分类'},
                ]
            }
        },
        methods: {
            switchTab(num) {
                if (num === 1) {
                    this.value = 0

                    let detailRule = `js:eval(fetch('hiker://files/TyrantG/LIVE/douyu.js'));cateGroupParse();`

                    fy_bridge_app.toDetailPage('所有分类', "https://m.douyu.com/api/cate/list", '333', '', detailRule, '')
                }

            }
        },
    });
</script>
</body>
</html>